import React, { Component } from 'react';
import './style/index.css';
import { Toast } from 'antd-mobile';

class Coupon extends Component {

    static defaultProps = {
        data: {
            price: '¥120',
            condition: '满500使用',
            timeLimit: '2020.1.1-2020.2.1',
            type: '新用户首充优惠券'
        }
    }
    agaix() {
        Toast.success("请求接口后领取成功", 1.5)
    }
    render() {
        const data = this.props.data;
        return (
            <div className='coupon'>
                <div className='couponContent'>
                    <div className='couponContentLeft'>
                        <span className='couponContentLeftP1'>{data.price}</span>
                        <span className='couponContentLeftP2'>{data.condition}</span>
                    </div>
                    <div className='couponContentRight'>
                        <span className='couponContentRightP1'>{data.type}</span>
                        <span className='couponContentRightP2'>{data.timeLimit}</span>
                        <span className='couponContentRightP3' onClick={() => this.agaix()}>领取</span>
                    </div>
                </div>
                <img src={require('./img/Combined .png')} width='100%' alt=''></img>
            </div>
        )
    }

}
export default Coupon;